package com.rd.student.jike.class2.lihongming.Solution713;

import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;

/**
 * @Auther:Heinrich
 * @Date:2023/7/14-07-14-15:09
 * @Description:com.rd.student.jike.class2.lihongming.Solution713
 * @version:1.0
 */
public class Question4 {
    public static LinkedList randomList(int num,int MaxValue,int MinValue){
        LinkedList list = new LinkedList();
        for (int i = 0; i < num; i++) {
            list.add((int)(Math.random()*(MaxValue-MinValue+1)+MinValue));
        }

        return list;
    }
    public static LinkedList screenList(LinkedList<Integer> list,int screenNum){
        Iterator iterator = list.iterator();
        LinkedList linkedList = new LinkedList();
        while (iterator.hasNext()){
            Integer  sc = (Integer) iterator.next();
            if(sc>screenNum){
                linkedList.add(sc);
            }
        }
        return linkedList;
    }

    public static void main(String[] args) {
        LinkedList randomList = randomList(10,100,1);
        LinkedList screenList = screenList(randomList,10);
        System.out.println(randomList);
        System.out.println(screenList);
    }
}


